package com.mateng.treasurechest.model.weather.service

import com.mateng.treasurechest.model.ServiceGenerator
import com.mateng.treasurechest.model.weather.bean.EveryDayImgBean
import retrofit2.http.GET
import retrofit2.http.Url
import rx.Observable

/**
 * Created by 樊磊 on 2018/2/2.
 */

interface IWeatherService {

    // 伴生类，类似于 java 的静态内部类
    companion object {
        private val SERVER_URL: String = "http://apicloud.mob.com/"
        val instance: IWeatherService
            get() {
                return ServiceGenerator.createService(IWeatherService::class.java, SERVER_URL)
            }
    }

    /**
     * 获取每日一图
     */
    @GET
    fun getEveryDayImg(@Url url: String): Observable<EveryDayImgBean>

}
